from dotenv import load_dotenv
import os

api_key = os.getenv("DeepSeek_API_KEY")
if not api_key:
    # 加载当前目录的 .env 文件（文件内容类似：SECRET_KEY=xxx）
    load_dotenv()
    # 从加载的变量中获取值，用法同 os.getenv()
    api_key = os.getenv("DeepSeek_API_KEY")

# https://python.langchain.com/api_reference/deepseek/chat_models/langchain_deepseek.chat_models.ChatDeepSeek.html
from langchain_deepseek import ChatDeepSeek

llm = ChatDeepSeek(
    model="deepseek-chat",
    temperature=0,
    max_tokens=None,
    timeout=None,
    max_retries=2,
    api_key=api_key,
    # other params...
)
